<template>
	<div class="child">
		<h3>子组件</h3>
		<h4>玩具：{{ two }}</h4>
		<h4>父给的车：{{ one }}</h4>
		<button @click="sentoTwo(two)">把玩具给父亲</button>
	</div>
</template>

<!-- 安装 vue 路由模块  npm install vue-router -->

<!-- npm i vite-plugin-vue-setup-extend -D -->
<script setup lang="ts" name="Child">
import { defineProps, ref } from 'vue'
let two = ref("奥特曼")
defineProps(["one", "sentoTwo"])
</script>

<style scoped>
.child {
	background-color: skyblue;
	padding: 10px;
	box-shadow: 0 0 10px black;
	border-radius: 10px;
}
</style>
